home *** CD-ROM | disk | FTP | other *** search
- /*
- * Run_Host.rexx
- *
- * USAGE: Run_Host(ProgPath,PortName)
- *
- * RETURN: boolean success
- *
- * This script is a function that run an external program and wait for its
- * arexx-port. First external function for the OLE system.
- *
- * $(C): (1994, Rocco Coluccelli, Bologna)
- *
- * $VER: Run_Host.rexx 1.02 (09.Sep.94)
- */
-
- OPTIONS RESULTS
-
- IF GETCLIP('debug') = 'yes' THEN TRACE ?r
-
- max_iter = 4
-
-
- IF ~SHOW('p',ARG(2)) THEN DO
-
- pos = LASTPOS('/',ARG(1))
- IF pos = 0 THEN
- pos = POS(':',ARG(1))
-
- IF pos > 0 THEN
- CALL PRAGMA('Directory',LEFT(ARG(1),pos))
-
- cmd = 'Run' ARG(1)
- ADDRESS COMMAND cmd
-
- cmd = 'WaitForPort' ARG(2)
- DO FOR max_iter WHILE ~SHOW('p',ARG(2))
- ADDRESS COMMAND cmd
- END
- END
-
- RETURN SHOW('p',ARG(2))
-